<?php

namespace Apps\Common\Models;

/**
 * 问题标签Model
 * @author     chenxiaolin
 * @date        2016年1月19日
 * @version     2.0.0
 * @copyright   Copyright 2016 meelier.com
 */
class QuestionTag extends \PhalconPlus\Database\Model
{

    /**
     *
     * @var integer
     */
    public $id;
    public $tag_id;

    /**
     *
     * @var string
     */
    public $tag_name;

    /**
     *
     * @var integer
     */
    public $question_id;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
//        $this->hasMany('tag_id', 'Apps\Common\Models\Question', 'question_tag', array('alias' => 'Question'));
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'question_tag';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return QuestionTag[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return QuestionTag
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

    /**
     * Independent Column Mapping.
     * Keys are the real names in the table and the values their names in the application
     *
     * @return array
     */
    public function columnMap()
    {
        return array(
            'id' => 'id',
            'tag_id' => 'tag_id',
            'tag_name' => 'tag_name',
            'question_id' => 'question_id'
        );
    }

    public function defaultColumns()
    {
        return [

        ];
    }

}
